package com.wnxy.article.controller;

import com.wnxy.article.entity.Article;
import com.wnxy.article.service.ArticleService;
import com.wnxy.article.vo.ArticleVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("article")
@Slf4j
public class ArticleController {

    @Autowired(required = false)
    private ArticleService articleService;

    @GetMapping
    public List<ArticleVo> findAll(){
        List<ArticleVo> list = articleService.findAll();
        return list;
    }
}
